﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Globalization;


namespace BT_web__nhom06
{
    public partial class Xoa_DV : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Label2.Text = Request.QueryString["id"];
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            
                int ketqua = 0;
                string masinhvien = Request.QueryString["id"];
                string lenhsql = "delete from doanvien where masinhvien = @masinhvien";
                ketqua = Tienichsql.ketnoicsdl.chaylenhcapnhatdulieu(lenhsql, new string[] { "@masinhvien" }, new object[] { masinhvien });
                if (ketqua == 1){
                    Label1.Text = "Da xoa";
                    Button2.Text = "Quay lại";
                    Button1.Visible = false;
                }
                else
                    Label1.Text = "Co su co xay ra!";
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("QL_ThongTinDV.aspx");
        }
    }
}